<#assign editableSubfix=['css','js','html','shtml','htm','xml','txt']/>
<div class="pageHeader">
    <form id="pagerForm" onsubmit="return navTabSearch(this);" method="post">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'path'/>:</label><label>${path?has_content?then(path+'/','/')}</label>
                </li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a href="cmsWebFile/content.html?path=${(path?url)!}" target="navTab" rel="cmsWebFile/content"><i class="icon-plus-sign-alt icon-large"></i> 创建文件</a></li>
            <li><a href="cmsWebFile/directory.html?path=${(path?url)!}" target="dialog" mask="true" width="500" height="200"><i class="icon-folder-close-alt icon-large"></i> 创建目录</a></li>
            <li><a href="cmsWebFile/upload.html?path=${(path?url)!}" target="dialog" mask="true" width="500" height="200"><i class="icon-upload icon-large"></i> <@t.page 'button.upload_file'/></a></li>
            <li><a href="cmsWebFile/zip.do?path=${(path?url)!'/'}&_csrf=<@_csrfToken admin=true/>" title="确定要压缩这个目录吗?" target="ajaxTodo"><i class="icon-upload icon-large"></i> 压缩当前目录</a></li>
            <li><a href="cmsWebFile/delete.do?_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.batch_delete_file'/>" target="selectedTodo" rel="paths"><i class="icon-trash icon-large"></i> <@t.page 'button.batch_delete'/></a></li>
        </ul>
    </div>
    <table class="list" width="100%" layoutH="65">
        <thead>
            <tr>
                <th width="20"><input type="checkbox" group="paths" class="checkboxCtrl"></th>
                <th width="30"></th>
                <th><@t.page 'name'/></th>
                <th><@t.page 'modified_date'/></th>
                <th><@t.page 'create_date'/></th>
                <th><@t.page 'file.size'/></th>
                <th><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody>
    <@_webFileList path=path>
        <#if path?has_content>
            <tr>
                <td></td>
                <td class="tree"><div class="folder_expandable"></div></td>
                <td>
                    <a href="cmsWebFile/list.html?path=${path?keep_before_last('/')}" target="navTab" rel="cmsWebFile/list" title="<@t.page 'button.return'/>">
                        <@t.page 'button.return'/>
                    </a>
                </td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </#if>
        <#list list as a>
            <#assign filePath=path?has_content?then(path+'/','/')+a.fileName/>
            <tr>
                <td><input name="paths" value="${filePath}" type="checkbox"></td>
                <td class="tree"><div class="${a.directory?then('folder_expandable','file')}" style="width:30px;"></div></td>
                <td>
                    <#if a.directory>
                        <a href="cmsWebFile/list.html?path=${filePath?url}" target="navTab" rel="cmsWebFile/list">
                            ${a.fileName}
                        </a>
                    <#else>
                    ${a.fileName}
                    </#if>
                </td>
                <td>${a.lastModifiedTime?datetime}</td>
                <td>${a.creationTime?datetime}</td>
                <td><@t.fileSize a.size/></td>
                <td>
                    <#if a.directory>
                        <a href="cmsWebFile/zip.do?path=${filePath?url}&_csrf=<@_csrfToken admin=true/>" title="确定要压缩这个目录吗?" target="ajaxTodo">压缩目录</a>
                    <#else>
                        <#if a.fileName?ends_with('.zip')>
                            <a href="cmsWebFile/unzip.do?path=${filePath?url}&_csrf=<@_csrfToken admin=true/>" title="确定要解压缩这个文件么?" target="ajaxTodo">解压缩</a>
                            <a href="cmsWebFile/unzipHere.do?path=${filePath?url}&_csrf=<@_csrfToken admin=true/>" title="确定要解压缩这个文件到当前目录么?" target="ajaxTodo">解压缩到当前目录</a>
                        </#if>
                        <#if editableSubfix?seq_contains(a.fileName?keep_after_last('.')?lower_case)>
                          <a href="cmsWebFile/content.html?path=${filePath?url}" target="navTab" rel="cmsWebFile/content:${filePath}" icon="<i class='icon-edit icon-large'></i>" title="文件编辑:${filePath}"><@t.page 'button.edit'/></a>
                        </#if>
                        <a href="${site.sitePath+filePath?keep_after('/')}" target="_blank"><@t.page 'button.view'/></a>
                    </#if>
                </td>
            </tr>
        </#list>
    </@_webFileList>
        </tbody>
    </table>
</div>